<div class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:700px;">
 <?= form_open('founder/leave_management/grant_leave/'.$id)?> 
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Absent Request Form</h3>
  </div>
  <div class="modal-body">  
 <table width="100%" class="table table-bordered table-condensed">
  <?php 
foreach($user as $user_detail)
{
?>  
  <tr>
    <td width="31%"><strong>Name</strong></td>
    <td colspan="2"><?= $user_detail->username?></td>
    </tr>  
  <tr>
    <td><strong>Reason</strong></td>
    <td colspan="2"><?= $user_detail->reason?></td>
    </tr>
  <tr>
    <td><strong>Applied on</strong></td>
    <td colspan="2"><?= $user_detail->applied_on?></td>
    </tr>
    <tr>
    <td><strong>Current Status</strong></td>
    <td colspan="2">
	<?= $user_detail->status?>		
	</td>
    </tr>
	<tr>
    <td><strong>Dates</strong></td>    
	<td colspan="2">
		<table class="table table-bordered">
			<?php $dates = $this->leave_model->get_leave_dates($user_detail->id);
				foreach($dates as $date){  ?>
					<tr>
						<td>
						<?php echo $date->date;?>
						<input type="hidden" value="<?php echo $date->date;?>" name="date[]"/>
						</td>
						<td> 
						<input type="radio" name="status[<?php echo $date->id;?>]" value="paid" <?php if($date->status == 'paid'){echo 'checked';}?>	/>&nbsp;&nbsp;Paid&nbsp;&nbsp;
						<input type="radio" name="status[<?php echo $date->id;?>]" value="unpaid" <?php if($date->status == 'unpaid'){echo 'checked';}?>	/>&nbsp;&nbsp;Unpaid&nbsp;&nbsp;
						<input type="radio" name="status[<?php echo $date->id;?>]" value="rejected" <?php if($date->status == 'rejected'){echo 'checked';}?>	/>&nbsp;Reject&nbsp;&nbsp;
						</td>
					</tr>
			<?php }?>
		</table>
	</td>
</tr>
  <tr>
  <td>
  	<strong>Paid Leave Available :</strong> 
	</td>
	<td>
		<input type="text" class="span1" value="<?php echo $allocated_leave;?>" readonly=""/>
	</td>
  </tr>
  
   <tr>
  <td>
  	<strong>Remark:</strong> 
	</td>
	<td>
		<textarea name="remarks"><?php if(!empty($user_detail->remarks)){ echo $user_detail->remarks; }?></textarea>
	</td>
  </tr>
<?php }?>
</table> 
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <input type="submit" class="btn btn-primary" value="Approve Leave" />
  </div>
  </form>
</div>


